﻿//
// Decompiled with: Decompiler.NET, Version=1.3.1.18439, Culture=neutral, PublicKeyToken=null, Version: 1.3.1.18439
// Decompilation Started at: 3/15/2009 10:34:26 PM
// Copyright 2003 - 2004, Jungle Creatures, Inc., All Rights Reserved. 
// Written by Jonathan Pierce, Email: support@junglecreatures.com
//

namespace PatientManagement

{
		
		#region Namespace Import Declarations
		
			using System.Collections;
			using System.ComponentModel;
			using System.Data.Common;
			using System.Data;
			using System.Data.SqlClient;
			using System.Drawing;
			using System;
			using System.Resources;
			using System.Windows.Forms;
			
		#endregion
		
	public class frmTraceUpdateBill : Form
	
	{
		
		#region Fields
			private Button btThoat;
			private Button btXem;
			private ComboBox cboBehaviour;
			private Container components;
			private string connStr;
			private int count;
			private DataGrid dataGrid1;
			private DateTimePicker ddlNgay;
			public int flag;
			private Label label1;
			private Label label2;
			private Label lbNgay;
		#endregion
		
		#region Constructors
		
			public frmTraceUpdateBill ()
			
			{
				this.flag = 1;
				this.components = ((System.ComponentModel.Container) null);
				this.count = 0;
				this.InitializeComponent ();
				this.connStr = Connection.ConnectionString ();
				return;
			}
			
		#endregion
		
		#region Methods
		
			private void btThoat_Click (object sender, EventArgs e)
			
			{
				base.Close ();
				return;
			}
			
			private void btXem_Click (object sender, EventArgs e)
			
			{
				SqlConnection theSqlConnection;
				DataSet theDataSet;
				SqlDataAdapter theSqlDataAdapter;
				SqlDataAdapter theSqlDataAdapter2;
				SqlDataAdapter theSqlDataAdapter3;
				int i;
				string theString;
				string[] theStringArray;
				string[] theStringArray2;
				string[] theStringArray3;
				this.ddlNgay.Enabled = false;
				theSqlConnection = new SqlConnection (this.connStr);
				theDataSet = new DataSet ();
				this.ddlNgay.CustomFormat = "MM/dd/yyyy";
				if (this.cboBehaviour.SelectedItem.ToString () != "Nhập Hóa Đơn")
				{
					goto L_011C;
				}
				theStringArray = new string[5];
				theStringArray[0] = "Select * from  vw_UpdateInvoiceHistory where usnStatus = 1 and usnDateSearch bet"
				+ "ween \'";
				theStringArray[1] = this.ddlNgay.Text;
				theStringArray[2] = " 00:00:00 AM\' and dateAdd(dd,1,\'";
				theStringArray[3] = this.ddlNgay.Text;
				theStringArray[4] = " 00:00:00 AM\') ";
				theSqlDataAdapter = new SqlDataAdapter (string.Concat (theStringArray), theSqlConnection);
				theDataSet.Clear ();
				int i2 = theSqlDataAdapter.Fill (theDataSet, "vw_UpdateInvoiceHistory");
				if ((theDataSet != null) && ((theDataSet.Tables.Count != 0) && (theDataSet.Tables[0].Rows.Count != 0)))
				{
					goto L_0117;
				}
				
			L_00D7:
				
				{
				}
				DialogResult theDialogResult = MessageBox.Show ("Chưa có người nào nhập hóa đơn!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
				this.dataGrid1.DataSource = null;
				this.ddlNgay.CustomFormat = "dd/MM/yyyy";
				this.ddlNgay.Enabled = true;
				goto L_046F;
				
			L_0117:
				
				{
				}
				goto L_02D6;
				
			L_011C:
				
				{
				}
				if (this.cboBehaviour.SelectedItem.ToString () != "Hủy Hóa Đơn")
				{
					goto L_020A;
				}
				theStringArray2 = new string[5];
				theStringArray2[0] = "Select * from  vw_UserDeleteInvoice where usnDateSearch between \'";
				theStringArray2[1] = this.ddlNgay.Text;
				theStringArray2[2] = " 00:00:00 AM\' and dateAdd(dd,1,\'";
				theStringArray2[3] = this.ddlNgay.Text;
				theStringArray2[4] = " 00:00:00 AM\') ";
				theSqlDataAdapter2 = new SqlDataAdapter (string.Concat (theStringArray2), theSqlConnection);
				theDataSet.Clear ();
				int i3 = theSqlDataAdapter2.Fill (theDataSet, "vw_UpdateInvoiceHistory");
				if ((theDataSet != null) && ((theDataSet.Tables.Count != 0) && (theDataSet.Tables[0].Rows.Count != 0)))
				{
					goto L_0205;
				}
				
			L_01C5:
				
				{
				}
				DialogResult theDialogResult2 = MessageBox.Show ("Chưa có người nào nhập hóa đơn!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
				this.dataGrid1.DataSource = null;
				this.ddlNgay.CustomFormat = "dd/MM/yyyy";
				this.ddlNgay.Enabled = true;
				goto L_046F;
				
			L_0205:
				
				{
				}
				goto L_02D6;
				
			L_020A:
				
				{
				}
				theStringArray3 = new string[5];
				theStringArray3[0] = "Select * from  vw_UpdateInvoiceHistory where usnStatus = 0 and usnDateSearch bet"
				+ "ween \'";
				theStringArray3[1] = this.ddlNgay.Text;
				theStringArray3[2] = " 00:00:00 AM\' and dateAdd(dd,1,\'";
				theStringArray3[3] = this.ddlNgay.Text;
				theStringArray3[4] = " 00:00:00 AM\')";
				theSqlDataAdapter3 = new SqlDataAdapter (string.Concat (theStringArray3), theSqlConnection);
				theDataSet.Clear ();
				int i4 = theSqlDataAdapter3.Fill (theDataSet, "vw_UpdateInvoiceHistory");
				if ((theDataSet != null) && ((theDataSet.Tables.Count != 0) && (theDataSet.Tables[0].Rows.Count != 0)))
				{
					goto L_02D6;
				}
				
			L_0296:
				
				{
				}
				DialogResult theDialogResult3 = MessageBox.Show ("Chưa có người nào cập nhật hóa đơn!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
				this.dataGrid1.DataSource = null;
				this.ddlNgay.CustomFormat = "dd/MM/yyyy";
				this.ddlNgay.Enabled = true;
				goto L_046F;
				
			L_02D6:
				
				{
				}
				i = 0;
				goto L_03F3;
				
			L_02DE:
				
				{
				}
				if (this.cboBehaviour.SelectedItem.ToString () != "Hủy Hóa Đơn")
				{
					goto L_035A;
				}
				this.ddlNgay.CustomFormat = "dd/MM/yyyy";
				this.dataGrid1.Enabled = true;
				this.dataGrid1.DataSource = theDataSet;
				this.dataGrid1.SetDataBinding (theDataSet, "vw_UpdateInvoiceHistory");
				this.dataGrid1.ReadOnly = true;
				this.dataGrid1.TableStyles.Clear ();
				this.loadDataGridHuy ();
				goto L_03ED;
				
			L_035A:
				
				{
				}
				theString = theDataSet.Tables["vw_UpdateInvoiceHistory"].Rows[i]["invPaymentStatus"].ToString ();
				if (theString != "0")
				{
					goto L_03C2;
				}
				theDataSet.Tables["vw_UpdateInvoiceHistory"].Rows[i]["invPaymentStatus"] = "Một lần";
				goto L_03ED;
				
			L_03C2:
				
				{
				}
				theDataSet.Tables["vw_UpdateInvoiceHistory"].Rows[i]["invPaymentStatus"] = "Trả chậm";
				
			L_03ED:
				
				{
				}
				i++;
				
			L_03F3:
				
				{
				}
				if (i < theDataSet.Tables["vw_UpdateInvoiceHistory"].Rows.Count)
				{
					goto L_02DE;
				}
				this.ddlNgay.CustomFormat = "dd/MM/yyyy";
				this.dataGrid1.Enabled = true;
				this.dataGrid1.DataSource = theDataSet;
				this.dataGrid1.SetDataBinding (theDataSet, "vw_UpdateInvoiceHistory");
				this.dataGrid1.ReadOnly = true;
				this.dataGrid1.TableStyles.Clear ();
				this.loadDataGrid ();
				
			L_046F:
				return;
			}
			
			private void cboBehaviour_SelectedIndexChanged (object sender, EventArgs e)
			
			{
				this.count++;
				if (this.count == 1)
				{
					goto L_0049;
				}
				
			L_0019:
				
				{
				}
				this.ddlNgay.Enabled = true;
				this.ddlNgay.Visible = true;
				this.lbNgay.Visible = true;
				this.btXem.Visible = true;
				
			L_0049:
				return;
			}
			
			protected override void Dispose (bool disposing)
			
			{
				this.flag = 0;
				if (! disposing)
				{
					goto L_001D;
				}
				if (this.components == null)
				{
					goto L_001D;
				}
				this.components.Dispose ();
				
			L_001D:
				
				{
				}
				base.Dispose (disposing);
				return;
			}
			
			private void frmTraceUpdateBill_Load (object sender, EventArgs e)
			
			{
				DateTime theDateTime;
				SqlConnection theSqlConnection;
				SqlDataAdapter theSqlDataAdapter;
				DataSet theDataSet;
				SqlDataAdapter theSqlDataAdapter2;
				SqlDataAdapter theSqlDataAdapter3;
				int i;
				string theString;
				string theString2;
				this.ddlNgay.Text = (theDateTime = DateTime.Now).ToString ();
				int i2 = this.cboBehaviour.Items.Add ("Nhập hóa Đơn");
				int i3 = this.cboBehaviour.Items.Add ("Cập Nhật Hóa Đơn");
				int i4 = this.cboBehaviour.Items.Add ("Hủy Hóa Đơn");
				theSqlConnection = new SqlConnection (this.connStr);
				theSqlDataAdapter = new SqlDataAdapter ("Select * from  vw_UpdateInvoiceHistory where usnStatus = 1", theSqlConnection);
				theDataSet = new DataSet ();
				int i5 = theSqlDataAdapter.Fill (theDataSet, "vw_UpdateInvoiceHistory");
				if ((theDataSet != null) && ((theDataSet.Tables.Count != 0) && (theDataSet.Tables[0].Rows.Count != 0)))
				{
					goto L_015A;
				}
				
			L_00B0:
				
				{
				}
				theSqlDataAdapter2 = new SqlDataAdapter ("Select * from  vw_UpdateInvoiceHistory where usnStatus = 0", theSqlConnection);
				theDataSet.Clear ();
				int i6 = theSqlDataAdapter2.Fill (theDataSet, "vw_UpdateInvoiceHistory");
				if ((theDataSet != null) && ((theDataSet.Tables.Count != 0) && (theDataSet.Tables[0].Rows.Count != 0)))
				{
					goto L_015A;
				}
				
			L_00F9:
				
				{
				}
				theSqlDataAdapter3 = new SqlDataAdapter ("Select * from  vw_UserDeleteInvoice ", theSqlConnection);
				theDataSet.Clear ();
				int i7 = theSqlDataAdapter3.Fill (theDataSet, "vw_UpdateInvoiceHistory");
				if ((theDataSet != null) && ((theDataSet.Tables.Count != 0) && (theDataSet.Tables[0].Rows.Count != 0)))
				{
					goto L_015A;
				}
				
			L_0142:
				
				{
				}
				DialogResult theDialogResult = MessageBox.Show ("Chưa có người nào cập nhật hóa đơn!", "Thông Báo", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
				goto L_0329;
				
			L_015A:
				
				{
				}
				i = 0;
				goto L_02B1;
				
			L_0162:
				
				{
				}
				theString = theDataSet.Tables["vw_UpdateInvoiceHistory"].Rows[i]["invPaymentStatus"].ToString ();
				if (theString != "0")
				{
					goto L_01CA;
				}
				theDataSet.Tables["vw_UpdateInvoiceHistory"].Rows[i]["invPaymentStatus"] = "Một lần";
				goto L_0230;
				
			L_01CA:
				
				{
				}
				if (theString != "2")
				{
					goto L_0205;
				}
				theDataSet.Tables["vw_UpdateInvoiceHistory"].Rows[i]["invPaymentStatus"] = "Hoàn tất trả chậm";
				goto L_0230;
				
			L_0205:
				
				{
				}
				theDataSet.Tables["vw_UpdateInvoiceHistory"].Rows[i]["invPaymentStatus"] = "Trả chậm";
				
			L_0230:
				
				{
				}
				theString2 = theDataSet.Tables["vw_UpdateInvoiceHistory"].Rows[i]["usnStatus"].ToString ();
				if (theString2 != "0")
				{
					goto L_027B;
				}
				this.cboBehaviour.SelectedItem = "Cập Nhật Hóa Đơn";
				
			L_027B:
				
				{
				}
				if (theString2 != "1")
				{
					goto L_029B;
				}
				this.cboBehaviour.SelectedItem = "Nhập Hóa Đơn";
				goto L_02AB;
				
			L_029B:
				
				{
				}
				this.cboBehaviour.SelectedItem = "Hủy Hóa Đơn";
				
			L_02AB:
				
				{
				}
				i++;
				
			L_02B1:
				
				{
				}
				if (i < theDataSet.Tables["vw_UpdateInvoiceHistory"].Rows.Count)
				{
					goto L_0162;
				}
				this.dataGrid1.Enabled = true;
				this.dataGrid1.DataSource = theDataSet;
				this.dataGrid1.SetDataBinding (theDataSet, "vw_UpdateInvoiceHistory");
				this.dataGrid1.ReadOnly = true;
				this.dataGrid1.TableStyles.Clear ();
				this.loadDataGrid ();
				theSqlDataAdapter.Dispose ();
				theSqlConnection.Close ();
				
			L_0329:
				return;
			}
			
			private void InitializeComponent ()
			
			{
				ResourceManager theResourceManager;
				Control[] theControlArray;
				theResourceManager = new ResourceManager (typeof (frmTraceUpdateBill));
				this.label2 = new Label ();
				this.dataGrid1 = new DataGrid ();
				this.btThoat = new Button ();
				this.cboBehaviour = new ComboBox ();
				this.label1 = new Label ();
				this.ddlNgay = new DateTimePicker ();
				this.lbNgay = new Label ();
				this.btXem = new Button ();
				((ISupportInitialize) this.dataGrid1).BeginInit ();
				base.SuspendLayout ();
				this.label2.Font = new System.Drawing.Font ("Verdana", 12F, FontStyle.Bold, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label2.ForeColor = Color.MediumBlue;
				this.label2.Location = new Point (168, 8);
				this.label2.Name = "label2";
				this.label2.Size = new System.Drawing.Size (384, 23);
				this.label2.TabIndex = 1;
				this.label2.Text = "Quản Lý Việc Cập Nhật Hóa Đơn";
				this.label2.TextAlign = ContentAlignment.MiddleCenter;
				this.dataGrid1.BackgroundColor = SystemColors.ActiveCaptionText;
				this.dataGrid1.CaptionVisible = false;
				this.dataGrid1.DataMember = "";
				this.dataGrid1.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.dataGrid1.HeaderForeColor = SystemColors.ControlText;
				this.dataGrid1.Location = new Point (8, 72);
				this.dataGrid1.Name = "dataGrid1";
				this.dataGrid1.Size = new System.Drawing.Size (672, 192);
				this.dataGrid1.TabIndex = 5;
				this.btThoat.FlatStyle = FlatStyle.Popup;
				this.btThoat.Font = new System.Drawing.Font ("Verdana", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.btThoat.Location = new Point (607, 267);
				this.btThoat.Name = "btThoat";
				this.btThoat.Size = new System.Drawing.Size (72, 23);
				this.btThoat.TabIndex = 34;
				this.btThoat.Text = "Thoát";
				this.btThoat.Click += new EventHandler (this.btThoat_Click);
				this.cboBehaviour.Location = new Point (136, 48);
				this.cboBehaviour.Name = "cboBehaviour";
				this.cboBehaviour.Size = new System.Drawing.Size (144, 24);
				this.cboBehaviour.TabIndex = 35;
				this.cboBehaviour.SelectedIndexChanged += new EventHandler (this.cboBehaviour_SelectedIndexChanged);
				this.label1.Font = new System.Drawing.Font ("Verdana", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.label1.Location = new Point (67, 50);
				this.label1.Name = "label1";
				this.label1.Size = new System.Drawing.Size (64, 16);
				this.label1.TabIndex = 36;
				this.label1.Text = "Hành vi : ";
				this.ddlNgay.CustomFormat = "dd/MM/yyyy";
				this.ddlNgay.Format = DateTimePickerFormat.Custom;
				this.ddlNgay.Location = new Point (400, 48);
				this.ddlNgay.Name = "ddlNgay";
				this.ddlNgay.Size = new System.Drawing.Size (104, 23);
				this.ddlNgay.TabIndex = 37;
				this.ddlNgay.Visible = false;
				this.lbNgay.Font = new System.Drawing.Font ("Verdana", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.lbNgay.Location = new Point (344, 50);
				this.lbNgay.Name = "lbNgay";
				this.lbNgay.Size = new System.Drawing.Size (48, 16);
				this.lbNgay.TabIndex = 38;
				this.lbNgay.Text = "Ngày : ";
				this.lbNgay.Visible = false;
				this.btXem.FlatStyle = FlatStyle.Popup;
				this.btXem.Font = new System.Drawing.Font ("Verdana", 9F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				this.btXem.Location = new Point (528, 48);
				this.btXem.Name = "btXem";
				this.btXem.Size = new System.Drawing.Size (72, 23);
				this.btXem.TabIndex = 39;
				this.btXem.Text = "Xem";
				this.btXem.Visible = false;
				this.btXem.Click += new EventHandler (this.btXem_Click);
				this.AutoScaleBaseSize = new System.Drawing.Size (7, 16);
				base.ClientSize = new System.Drawing.Size (686, 293);
				theControlArray = new Control[8];
				theControlArray[0] = ((Control) this.btXem);
				theControlArray[1] = ((Control) this.lbNgay);
				theControlArray[2] = ((Control) this.ddlNgay);
				theControlArray[3] = ((Control) this.label1);
				theControlArray[4] = ((Control) this.cboBehaviour);
				theControlArray[5] = ((Control) this.btThoat);
				theControlArray[6] = ((Control) this.dataGrid1);
				theControlArray[7] = ((Control) this.label2);
				base.Controls.AddRange (theControlArray);
				this.Font = new System.Drawing.Font ("Verdana", 9.75F, FontStyle.Regular, GraphicsUnit.Point, ((byte) byte.MinValue));
				base.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow;
				base.Icon = ((System.Drawing.Icon) theResourceManager.GetObject ("$this.Icon"));
				base.MaximizeBox = false;
				base.MinimizeBox = false;
				base.Name = "frmTraceUpdateBill";
				base.StartPosition = FormStartPosition.CenterScreen;
				this.Text = "Quản lý việc cập nhật hóa đơn";
				base.Load += new EventHandler (this.frmTraceUpdateBill_Load);
				((ISupportInitialize) this.dataGrid1).EndInit ();
				base.ResumeLayout (false);
				return;
			}
			
			public void loadDataGrid ()
			
			{
				DataGridTableStyle theDataGridTableStyle;
				DataGridTextBoxColumn theDataGridTextBoxColumn;
				DataGridTextBoxColumn theDataGridTextBoxColumn2;
				DataGridTextBoxColumn theDataGridTextBoxColumn3;
				DataGridTextBoxColumn theDataGridTextBoxColumn4;
				DataGridTextBoxColumn theDataGridTextBoxColumn5;
				DataGridTextBoxColumn theDataGridTextBoxColumn6;
				DataGridTextBoxColumn theDataGridTextBoxColumn7;
				DataGridTextBoxColumn theDataGridTextBoxColumn8;
				DataGridTextBoxColumn theDataGridTextBoxColumn9;
				DataGridTextBoxColumn theDataGridTextBoxColumn10;
				DataGridTextBoxColumn theDataGridTextBoxColumn11;
				theDataGridTableStyle = new DataGridTableStyle ();
				theDataGridTableStyle.MappingName = "vw_UpdateInvoiceHistory";
				theDataGridTableStyle.AlternatingBackColor = Color.AliceBlue;
				theDataGridTableStyle.HeaderForeColor = Color.Maroon;
				theDataGridTableStyle.GridLineColor = Color.CornflowerBlue;
				theDataGridTextBoxColumn = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn.MappingName = "invISN";
                theDataGridTextBoxColumn.HeaderText = "Mã Hóa Đơn";
				theDataGridTextBoxColumn.Width = 100;
				theDataGridTextBoxColumn.NullText = string.Empty;
				int i = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn));
				theDataGridTextBoxColumn2 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn2.MappingName = "clrISN";
                theDataGridTextBoxColumn2.HeaderText = "Mã Bệnh Án";
				theDataGridTextBoxColumn2.Width = 100;
				theDataGridTextBoxColumn2.NullText = string.Empty;
				int i2 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn2));
				theDataGridTextBoxColumn3 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn3.MappingName = "patID";
				theDataGridTextBoxColumn3.HeaderText = "Số ID";
				theDataGridTextBoxColumn3.Width = 100;
				theDataGridTextBoxColumn3.NullText = string.Empty;
				int i3 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn3));
				theDataGridTextBoxColumn4 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn4.MappingName = "patName";
				theDataGridTextBoxColumn4.HeaderText = "Tên Bệnh Nhân";
				theDataGridTextBoxColumn4.Width = 210;
				theDataGridTextBoxColumn4.NullText = string.Empty;
				int i4 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn4));
				theDataGridTextBoxColumn5 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn5.MappingName = "clrExaminationDate";
				theDataGridTextBoxColumn5.HeaderText = "Ngày Khám";
				theDataGridTextBoxColumn5.Width = 150;
				theDataGridTextBoxColumn5.NullText = string.Empty;
				int i5 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn5));
				theDataGridTextBoxColumn6 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn6.MappingName = "usnMoneyBeforeUpdate";
				theDataGridTextBoxColumn6.HeaderText = "Số tiền TT trước(CN)";
				theDataGridTextBoxColumn6.Width = 180;
				theDataGridTextBoxColumn6.NullText = string.Empty;
				int i6 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn6));
				theDataGridTextBoxColumn7 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn7.MappingName = "invTotalPayment";
				theDataGridTextBoxColumn7.HeaderText = "Số tiền TT sau(CN)";
				theDataGridTextBoxColumn7.Width = 180;
				theDataGridTextBoxColumn7.NullText = string.Empty;
				int i7 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn7));
				theDataGridTextBoxColumn8 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn8.MappingName = "invPaymentStatus";
				theDataGridTextBoxColumn8.HeaderText = "Khả năng thanh toán";
				theDataGridTextBoxColumn8.Width = 180;
				theDataGridTextBoxColumn8.NullText = string.Empty;
				int i8 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn8));
				theDataGridTextBoxColumn9 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn9.MappingName = "usrName";
				theDataGridTextBoxColumn9.HeaderText = "Người Cập Nhật";
				theDataGridTextBoxColumn9.Width = 180;
				theDataGridTextBoxColumn9.NullText = string.Empty;
				int i9 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn9));
				theDataGridTextBoxColumn10 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn10.MappingName = "usnDate";
				theDataGridTextBoxColumn10.HeaderText = "Ngày Cập Nhật";
				theDataGridTextBoxColumn10.Width = 165;
				theDataGridTextBoxColumn10.NullText = string.Empty;
				int i10 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn10));
				theDataGridTextBoxColumn11 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn11.MappingName = "usnReason";
				theDataGridTextBoxColumn11.HeaderText = "Lý Do Cập Nhật";
				theDataGridTextBoxColumn11.Width = 160;
				theDataGridTextBoxColumn11.NullText = string.Empty;
				int i11 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn11));
				int i12 = this.dataGrid1.TableStyles.Add (theDataGridTableStyle);
				return;
			}
			
			public void loadDataGridHuy ()
			
			{
				DataGridTableStyle theDataGridTableStyle;
				DataGridTextBoxColumn theDataGridTextBoxColumn;
				DataGridTextBoxColumn theDataGridTextBoxColumn2;
				DataGridTextBoxColumn theDataGridTextBoxColumn3;
				DataGridTextBoxColumn theDataGridTextBoxColumn4;
				DataGridTextBoxColumn theDataGridTextBoxColumn5;
				DataGridTextBoxColumn theDataGridTextBoxColumn6;
				DataGridTextBoxColumn theDataGridTextBoxColumn7;
				DataGridTextBoxColumn theDataGridTextBoxColumn8;
				theDataGridTableStyle = new DataGridTableStyle ();
				theDataGridTableStyle.MappingName = "vw_UpdateInvoiceHistory";
				theDataGridTableStyle.AlternatingBackColor = Color.AliceBlue;
				theDataGridTableStyle.HeaderForeColor = Color.Maroon;
				theDataGridTableStyle.GridLineColor = Color.CornflowerBlue;
				theDataGridTextBoxColumn = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn.MappingName = "invISN";
				theDataGridTextBoxColumn.HeaderText = "Mã Hóa Đơn";
				theDataGridTextBoxColumn.Width = 100;
				theDataGridTextBoxColumn.NullText = string.Empty;
				int i = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn));
				theDataGridTextBoxColumn2 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn2.MappingName = "clrISN";
				theDataGridTextBoxColumn2.HeaderText = "Mã Bệnh Án";
				theDataGridTextBoxColumn2.Width = 131;
				theDataGridTextBoxColumn2.NullText = string.Empty;
				int i2 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn2));
				theDataGridTextBoxColumn3 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn3.MappingName = "patID";
				theDataGridTextBoxColumn3.HeaderText = "Số ID";
				theDataGridTextBoxColumn3.Width = 100;
				theDataGridTextBoxColumn3.NullText = string.Empty;
				int i3 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn3));
				theDataGridTextBoxColumn4 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn4.MappingName = "patName";
				theDataGridTextBoxColumn4.HeaderText = "Tên Bệnh Nhân";
				theDataGridTextBoxColumn4.Width = 210;
				theDataGridTextBoxColumn4.NullText = string.Empty;
				int i4 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn4));
				theDataGridTextBoxColumn5 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn5.MappingName = "clrExaminationDate";
				theDataGridTextBoxColumn5.HeaderText = "Ngày Khám";
				theDataGridTextBoxColumn5.Width = 150;
				theDataGridTextBoxColumn5.NullText = string.Empty;
				int i5 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn5));
				theDataGridTextBoxColumn6 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn6.MappingName = "usrName";
				theDataGridTextBoxColumn6.HeaderText = "Người Cập Nhật";
				theDataGridTextBoxColumn6.Width = 180;
				theDataGridTextBoxColumn6.NullText = string.Empty;
				int i6 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn6));
				theDataGridTextBoxColumn7 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn7.MappingName = "usnDate";
				theDataGridTextBoxColumn7.HeaderText = "Ngày Hủy";
				theDataGridTextBoxColumn7.Width = 165;
				theDataGridTextBoxColumn7.NullText = string.Empty;
				int i7 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn7));
				theDataGridTextBoxColumn8 = new DataGridTextBoxColumn ();
				theDataGridTextBoxColumn8.MappingName = "usnReason";
				theDataGridTextBoxColumn8.HeaderText = "Lý Do Hủy";
				theDataGridTextBoxColumn8.Width = 160;
				theDataGridTextBoxColumn8.NullText = string.Empty;
				int i8 = theDataGridTableStyle.GridColumnStyles.Add (((DataGridColumnStyle) theDataGridTextBoxColumn8));
				int i9 = this.dataGrid1.TableStyles.Add (theDataGridTableStyle);
				return;
			}
			
			public string parseTien (string tien)
			
			{
				ArrayList theArrayList;
				int i;
				char[] theCharArray;
				ArrayList theArrayList2;
				int i2;
				int i3;
				int i4;
				string theString;
				int i5;
				string theString2;
				theArrayList = new ArrayList ();
				i = 3;
				goto L_001C;
				
			L_000A:
				
				{
				}
				int i6 = theArrayList.Add (i.ToString ());
				i += 3;
				
			L_001C:
				
				{
				}
				if (i < 100)
				{
					goto L_000A;
				}
				theCharArray = tien.ToCharArray ();
				theArrayList2 = new ArrayList ();
				i2 = 1;
				i3 = theCharArray.Length;
				goto L_009B;
				
			L_0038:
				
				{
				}
				int i7 = theArrayList2.Add (theCharArray[(i3 - 1)].ToString ());
				i4 = 0;
				goto L_0085;
				
			L_0053:
				
				{
				}
				if (theArrayList[i4].ToString () != i2.ToString ())
				{
					goto L_007F;
				}
				if (i3 <= 1)
				{
					goto L_007F;
				}
				int i8 = theArrayList2.Add (".");
				
			L_007F:
				
				{
				}
				i4++;
				
			L_0085:
				
				{
				}
				if (i4 < theArrayList.Count)
				{
					goto L_0053;
				}
				i2++;
				i3--;
				
			L_009B:
				
				{
				}
				if ((i3 <= theCharArray.Length) && (i3 > 0))
				{
					goto L_0038;
				}
				
			L_00A7:
				
				{
				}
				theString = string.Empty;
				i5 = theArrayList2.Count;
				goto L_00D6;
				
			L_00B8:
				
				{
				}
				theString = string.Concat (theString, theArrayList2[((int) (i5 - 1))].ToString ());
				i5--;
				
			L_00D6:
				
				{
				}
				if (i5 > theArrayList2.Count)
				{
					goto L_00E5;
				}
				if (i5 > 0)
				{
					goto L_00B8;
				}
				
			L_00E5:
				
				{
				}
				theString2 = theString;
				goto L_00EB;
				
			L_00EB:
				
				{
				}
				return theString2;
			}
			
		#endregion
	}
	
}

